package cn.wangqi.personal.sql;

import org.junit.Test;

import java.io.IOException;
import java.sql.SQLException;

public class SQLTest {
    public static void main(String []args){
        MapperUtil mapperUtil = new MapperUtil();
        String []tables = new String[]{"tbl_blog_user"};
        String java = "E:\\EclipseWorkspace\\personal\\client\\src\\main\\java\\cn\\wangqi\\personal\\domain";
        String mapper = "E:\\EclipseWorkspace\\personal\\entity\\src\\main\\resources\\mapper";
        String pack = "cn.wangqi.personal.domain";
        String daoPath = "E:\\EclipseWorkspace\\personal\\entity\\src\\main\\java\\cn\\wangqi\\personal\\dao";
        String servicePath="F:\\learning_project\\learning\\business_admin\\src\\main\\java\\com\\ytx\\learning\\admin\\goods\\service";
        String controllerPath="F:\\learning_project\\learning\\business_admin\\src\\main\\java\\com\\ytx\\learning\\admin\\goods\\controller";
        try {
            mapperUtil.generate(tables, mapper, java, pack, daoPath, null, null);
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testString(){
        String daoPath = "F:\\learning_project\\learning\\entity\\src\\main\\java\\com\\ytx\\learning\\goods\\dao";
        String path = daoPath.substring(daoPath.indexOf("java") + 5);
        path = path.replace("\\", ".");
        System.out.println(path);
    }

}
